package com.pybox.repository;

import com.pybox.entity.TChangNameDan;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;

public interface TChangNameDanRepository extends JpaRepository<TChangNameDan, Integer>, JpaSpecificationExecutor<TChangNameDan> {

    @Modifying
    @Query(value = "update TChangNameDan u set u.t_status = 2 , u.results = ?2, u.token_pwd = ?3,u.utime=?4  where u.id = ?1 ")
    @Transactional
    void updateTStatus(int id, String message, String token_pwd, Date date);

}

